package net.mikoo.seals.boss.biz.services;

import net.mikoo.seals.boss.common.exception.AccountNotFindException;
import net.mikoo.seals.boss.common.exception.ParametersException;
import net.mikoo.seals.boss.model.Party;
import net.mikoo.seals.boss.model.UserLogin;

public interface UserLoginServices {
	
	
	/**
	 * 授权登录 管理员
	 * @author huangxm
	 * @param username
	 * @param password
	 * @param partyType
	 * @return
	 * @throws ParametersException 
	 * @throws AccountNotFindException 
	 */
	public Party authLogin(String username, String password, String partyType);
	
	public void changePassword(String username,String newPassword, String oldPassword);
	
	public boolean isRightByPassword(String userLoginId, String currentPassword);
	
	public UserLogin loadByPrimaryKey(String userLoginId);
	
	/**
	 * 删除当事人
	 * 
	 * @param partyId
	 * @return 删除结果
	 */
	public void deleteByPartyId(Long partyId);
	
	/**
	 * 修改用户登录信息
	 * 
	 * @param userLevel
	 * @return 修改结果
	 */
	public void updateByPartyId(UserLogin userLogin);

	
	/**
	 * @author huangxm
	 * 校验关键字是否存在
	 * @param verifykey   验证字段
	 * @param excludeKey  排除验证字段
	 * @param type   username:用户名，mobile：手机号码，邮箱：email
	 * @return
	 */
	public Boolean checkUsernameExist(String verifykey, String excludeKey, String type);

	public Party register(String username, String password);

	public  void resetPassword(String username, String newPassword);
	
}
